home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4390 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.7 KB

  1. Path: news.mindlink.net!news
  2. From: genew@mindlink.bc.ca (Gene Wirchenko)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: why not add getch() to the std C RTL?
  5. Date: Sun, 04 Feb 1996 05:47:35 GMT
  6. Organization: MIND LINK! - British Columbia, Canada
  7. Message-ID: <4f1hd9$h79@fountain.mindlink.net>
  8. References: <DM85L8.5Jn@emr1.emr.ca> <bnelsonDM887t.LDI@netcom.com>
  9. NNTP-Posting-Host: line241.nwm.mindlink.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. bnelson@netcom.com (Bob Nelson) wrote:
  13.  
  14. >On Sun, 4 Feb 1996 00:05:32 GMT, John Grant wrote:
  15.  
  16. >> There are *many* people who want to do the following in their C programs:
  17. >> - read a single unbuffered keystroke (getch() in DOS, ioctl in unix...)
  18. >> The usual response is "not standard C, o/s-specific" etc.
  19.  
  20. >I'll just quote the following from "Expert C Programming" by Peter van
  21. >der Linden (ISBN 0-13-177429-8) and offer no comments of my own, other
  22. >than some emphasis added.  Instead, it'll be interesting to see how
  23. >participants in comp.lang.c respond to what PvdL thinks (especially in
  24. >the context of your posting). Here's the paragraph from page 213:
  25.  
  26. >"People often wonder why ANSI C didn't define a standard function to
  27. >get a character if a key has been pressed. Without a standard
  28. >function, every system has a different method and program portability
  29. >is lost.  The argument against providing kbhit() as part of the
  30. >standard is that *it is mostly useful for GAMES software* and there
  31. >are many other terminal I/O features that are not standardized. In
  32. >addition, you don't want to promise a standard library function *that
  33. >SOME OS's will find difficult to provide.* The argument for providing
  34. >it is that it is mostly useful for games software and that games
  35. >writers don't need the myriad of other terminal I/O features that
  36. >could be standardized. Whichever view you hold, it's true the XJ311
  37. >missed an opportunity to reinforce C as the language of choice for a
  38. >generation of programmers writings games on UNIX."
  39.  
  40. >Comments? 
  41. >-- 
  42. >=============================================================================
  43. >          Bob Nelson: Dallas, Texas, U.S.A.  -  bnelson@netcom.com
  44. >      Linux for fun, M$ for $$$...and the NFL for what really counts!
  45. >=============================================================================
  46.  
  47.      New, the game that will keep you on the edge of your seat:
  48.  
  49.           "Generating report - press <Escape> to interrupt..."
  50.  
  51.      If Mr. van der Linden plays baseball, it must be in left field,
  52. far, left field.  Disclaimer: "far" is being used in an ordinary
  53. English sense and not as a non-standard C keyword.
  54.  
  55. Sincerely,
  56.  
  57. Gene Wirchenko
  58.  
  59. C Pronunciation Guide:
  60.      y=x++;     "wye equals ex plus plus semicolon"
  61.      x=x++;     "ex equals ex doublecross semicolon"
  62.  
  63.